package basic

class Variable {
    //整型变量不能接受null值
    //var notNull:Int= null

    //Int?相当于支持null值的Int型
    var nullable: Int? = null


}

fun main(args: Array<String>) {
    var a: Int = 233
    var b: Byte = a.toByte()
    println(b)


    var bookPrice: Byte = 79
    var itemPrice: Short = 120

    var total = bookPrice + itemPrice
    //199
    println("total=$total")
    //total映射的Java类型是int
    println("total的类型是${total.javaClass}")

    var tot = bookPrice.toLong() + itemPrice.toByte()
    //199
    println("tot=$tot")
    //tot映射的Java类型是long
    println("tot的类型是${tot.javaClass}")


}